package com.wxq.demo.config;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;

@ControllerAdvice
public class GlobalConfig {
    @InitBinder("book")
    public void bookInit(WebDataBinder binder) {
        binder.setFieldDefaultPrefix("book.");
    }

    @InitBinder("author")
    public void authorInit(WebDataBinder binder) {
        binder.setFieldDefaultPrefix("author.");
    }
}
